package com.atguigu.srb.core.service;

import com.atguigu.srb.core.pojo.entity.UserAccount;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;

/**
 * <p>
 * 用户账户 服务类
 * </p>
 *
 * @author Atguigu
 * @since 2023-05-26
 */
public interface UserAccountService extends IService<UserAccount> {

    UserAccount getUserAccountByBindCode(String bindCode);

    BigDecimal getAmount(String token);

    BigDecimal getInterestCount(BigDecimal invest, Integer period, BigDecimal yearRate, Integer returnMethod);

    void updateInvestAmountByUserId(BigDecimal transAmount, Long userId);

    void updateFreezeAmountByUserId(Long investUserId, BigDecimal investAmount);

    String withDraw(String token, BigDecimal amount);

    String notifyWithdraw(HttpServletRequest request);
}
